package com.nami.dispatcher.domain.handler.impl;


import com.nami.dispatcher.domain.event.publish.RetryDownMsgOnceEvent;
import com.nami.dispatcher.domain.handler.RetryForwardPacketHandler;
import com.nami.dispatcher.domain.message.model.RetryMsgRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class RetryForwardPacketImpl implements RetryForwardPacketHandler {

    private final ApplicationEventPublisher eventPublisher;

    @Override
    public void retryHandler(RetryMsgRequest request) {
        eventPublisher.publishEvent(new RetryDownMsgOnceEvent(this, request));
    }


}
